# $Id: PKGBUILD 78246 2012-10-17 10:26:51Z allan $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Douglas Soares de Andrade <dsandrade@gmail.com>
# Contributor: Douglas Soares de Andrade <dsandrade@gmail.com>

pkgbase=python-pyserial
pkgname=('python-pyserial' 'python2-pyserial')
pkgver=2.6
pkgrel=3
pkgdesc="Multiplatform Serial Port Module for Python"
arch=('any')
url="http://pyserial.sf.net"
license=('custom:PYTHON')
makedepends=('python2' 'python')
source=(http://pypi.python.org/packages/source/p/pyserial/pyserial-$pkgver.tar.gz)
md5sums=('cde799970b7c1ce1f7d6e9ceebe64c98')

build() {
  true
}

package_python-pyserial() {
  depends=('python')

  cd $srcdir/pyserial-$pkgver
  python setup.py install --root=$pkgdir
  install -D -m644 LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE.txt
  sed -i -e '1,1d' -e '1,1i#!/usr/bin/python3' $pkgdir/usr/bin/miniterm.py
}

package_python2-pyserial() {
  depends=('python2')

  cd $srcdir/pyserial-$pkgver
  python2 setup.py install --root=$pkgdir
  install -D -m644 LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE.txt
  mv $pkgdir/usr/bin/miniterm.py $pkgdir/usr/bin/miniterm2.py
}
